{% extends "ads/base.html" %}

{% load i18n %}

{% block title %}{{ advertiser }} | {% trans "Advertiser" %} | {{ block.super }}{% endblock %}

{% block h1 %}{% trans "Advertiser Creation/Edition" %}{% endblock %}

{% block body %}

<div class="clear_both">
    <div class="box olive panel">
        <table class="form">
            <tr>
                <th>{% trans "Name" %}</th>
                <td>{{ advertiser }}</td>
            </tr>
        </table>
    </div>

    <div class="box orange">
        <a href="create_ad/">{% trans "Create a new Ad" %}</a>
    </div>

    <div class="box green">
        <a href="edit/">{% trans "Edit" %}</a>
    </div>
</div>

<div class="box silver clear_both">
    <h2>{% trans "Ads" %}</h2>

    {% if advertiser.ads.count %}
    <table class="list">
        <tr>
            <th>{% trans "Title" %}</th>
            <th>{% trans "All words" %}</th>
            <th>{% trans "Clicks/day" %}</th>
            <th>{% trans "Views" %}</th>
            <th>{% trans "Left today" %}</th>
            <th>{% trans "Clicks" %}</th>
            <th>{% trans "Left today" %}</th>
        </tr>
        {% for ad in advertiser.ads.all %}
        <tr>
            <td><a href="{{ ad.get_absolute_url }}">{{ ad }}</a></td>
            <td>{{ ad.all_words }}</td>
            <td>{{ ad.click_limit_per_day }}</td>
            <td>{{ ad.view_count }}</td>
            <td>{{ ad.view_credits }}</td>
            <td>{{ ad.click_count }}</td>
            <td>{{ ad.click_credits }}</td>
        </tr>
        {% endfor %}
    </table>
    {% else %}
    {% trans "This advertiser has no ads!" %}
    {% endif %}
</div>

{% endblock body %}

